home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / deletemsgport.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.5 KB  |  71 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: deletemsgport.c,v 1.4 1996/08/13 13:56:00 digulla Exp $
  4.     $Log: deletemsgport.c,v $
  5.     Revision 1.4  1996/08/13 13:56:00  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:09  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/ports.h>
  17. #include <exec/execbase.h>
  18. #include <aros/libcall.h>
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.     #include <clib/exec_protos.h>
  24.  
  25.     __AROS_LH1(void, DeleteMsgPort,
  26.  
  27. /*  SYNOPSIS */
  28.     __AROS_LHA(struct MsgPort *, port, A0),
  29.  
  30. /*  LOCATION */
  31.     struct ExecBase *, SysBase, 112, Exec)
  32.  
  33. /*  FUNCTION
  34.     Delete a messageport allocated with CreateMsgPort(). The signal bit
  35.     is freed and the memory is given back to the memory pool. Remaining
  36.     messages are not replied. It is safe to call this function with a
  37.     NULL pointer.
  38.  
  39.     INPUTS
  40.     port - Pointer to messageport structure.
  41.  
  42.     RESULT
  43.  
  44.     NOTES
  45.  
  46.     EXAMPLE
  47.  
  48.     BUGS
  49.  
  50.     SEE ALSO
  51.  
  52.     INTERNALS
  53.  
  54.     HISTORY
  55.  
  56. ******************************************************************************/
  57. {
  58.     __AROS_FUNC_INIT
  59.  
  60.     /* Only if there is something to free */
  61.     if(port!=NULL)
  62.     {
  63.     /* Free signal bit */
  64.     FreeSignal(port->mp_SigBit);
  65.  
  66.     /* And memory */
  67.     FreeMem(port,sizeof(struct MsgPort));
  68.     }
  69.     __AROS_FUNC_EXIT
  70. } /* DeleteMsgPort */
  71.